﻿// ParseLib - An open source library for natural language processing.
// Copyright (C) Kais Dukes, 2012. E-mail: kais@kaisdukes.com
// http://parselib.org

namespace ParseLib.Tagging
{
    public abstract class Tag
    {
        public ITagset Tagset { get; private set; }
        public string Symbol { get; private set; }
        public int Number { get; private set; }

        protected Tag(ITagset tagset, string symbol, int number)
        {
            Tagset = tagset;
            Symbol = symbol;
            Number = number;
        }

        public override bool Equals(object value)
        {
            var tag = (Tag) value;
            return tag.Tagset == Tagset && tag.Number == Number;
        }

        public bool Equals(PartOfSpeech partOfSpeech)
        {
            return partOfSpeech.Number == Number;
        }

        public override int GetHashCode()
        {
            return Number;
        }

        public override string ToString()
        {
            return Symbol;
        }
    }
}